<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>会员优惠券</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  #parse('/headFiles.html')
</head>
<body>
<div class="layui-fluid layui-form" wid100>
  <div class="layui-row">
    <div class="layui-col-sm6">
      <div class="layui-form-item">
        <label class="layui-form-label">会员ID</label>
        <div class="layui-input-block">
          <input type="text" name="memberId" lay-verify="required" placeholder="请输入会员ID" autocomplete="off" class="layui-input">
        </div>
      </div>
    </div>
    <div class="layui-col-sm6">
      <div class="layui-form-item">
        <label class="layui-form-label">到期时间</label>
        <div class="layui-input-block">
          <input type="text" id="expirationDate" name="expirationDate" placeholder="请输入优惠券到期时间" autocomplete="off" class="layui-input">
        </div>
      </div>
    </div>
  </div>
  <div class="layui-row">
    <div class="layui-col-sm6">
      <div class="layui-form-item">
        <label class="layui-form-label">优惠券类型</label>
        <div class="layui-input-block">
          <select name="couponType" lay-filter="couponType">
            #foreach($item in $couponTypeList)
            <option value="$!{item.index()}">$!{item.note()}</option>
            #end
          </select>
        </div>
      </div>
    </div>
  </div>
  <div class="layui-form-item layui-hide">
    <input type="button" lay-submit lay-filter="LAY-form-submit" id="LAY-form-submit" value="确认">
  </div>
</div>
#parse('/footFiles.html')
<script type="text/javascript">
layui.config({
  base: '$!{webRoot}/layuiadmin/'
  ,webRoot:'$!{webRoot}'
}).extend({
  index: 'lib/index'
}).use(['index', 'form', 'laydate'],function (){
  var $ = layui.$, form = layui.form, laydate = layui.laydate;

  laydate.render({
    elem: '#expirationDate'
    , type:'date'
    , range: false
  });

  form.on('select(useRange)', function(data){
    if(data.value == 1){
      $('#placeIdPlan').hide();
    }else {
      $('#placeIdPlan').show();
    }
  });

  form.on('select(useLimit)', function(data){
    if(data.value == 1){
      $('#businessTypePlan').hide();
    }else {
      $('#businessTypePlan').show();
    }
  });

  form.on('select(couponType)', function(data){
    if(data.value == 1){
      $('#couponMoneyStrPlan').hide();
      $('#couponDayPlan').hide();
      $('#couponDiscountPlan').show();
    }else if(data.value == 2){
      $('#couponDayPlan').hide();
      $('#couponDiscountPlan').hide();
      $('#couponMoneyStrPlan').show();
    }else if(data.value == 3){
      $('#couponMoneyStrPlan').hide();
      $('#couponDiscountPlan').hide();
      $('#couponDayPlan').show();
    }
  });

})
</script>
</body>
</html>